﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Collections.Generic;

namespace InstalledBrowsersWinApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            List<int> l;

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            int x = 10;
            foreach (var browser in Browser.GetAllInstalledBrowsers())
            {
                Button btn = new Button();
                btn.Tag = browser;
                btn.Click += new EventHandler(btn_Click);
                btn.Top = x;
                btn.Image = browser.SmallIcon.ToBitmap();
                this.Controls.Add(btn);
                x += 30;
            }
        }

        void btn_Click(object sender, EventArgs e)
        {
            (((sender as Button).Tag) as Browser).MakeDefaultForVisualStudio();
            Process.Start("http://www.google.com");
        }
    }
}
